﻿using UnityEngine;
using System.Collections.Generic;

namespace Dict.Blo
{
    public class DictUnionFightCariotBlo
    {
        static public List<Dict.DataModel.TableUnionFightCariot> GetAll()
        {
            return Dict.DictDataManager.Instance.tableUnionFightCariotDao.CacheList;
        }

        static public Dict.DataModel.TableUnionFightCariot GetUnionFightCariotByID(string id)
        {
            return Dict.DictDataManager.Instance.tableUnionFightCariotDao.GetById(id);
        }

        static public float GetAngle(string id)
        {
            return (float)DictUnionFightFactoryBlo.GetUnionFightFactoryByID(GetUnionFightCariotByID(id).UFFId + "").CariotAngle;
        }

        static public Vector3 GetPosition(string id)
        {
            var pos = DictUnionFightFactoryBlo.GetUnionFightFactoryByID(GetUnionFightCariotByID(id).UFFId + "").CariotBornPos;
            var sss = pos.Trim().Split(new char[1] { ',' }, System.StringSplitOptions.RemoveEmptyEntries);
            var x = float.Parse(sss[0]);
            var y = float.Parse(sss[1]);
            var z = float.Parse(sss[2]);

            return new Vector3(x, y, z);
        }
    }
}